# Fetching a list of Subscribed Events

Returns up to 9 days of records for all [event types](https://mavenlink.zendesk.com/hc/en-us/articles/4407962435227),
unless filter parameters have been applied.
Only records associated with the requester's Kantata OX account are returned.
This endpoint returns structured Subscribed Event objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `subscribed_events` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: GET /subscribed_events
Version: 1.0.0

## Query parameters:

  - `created_after` (string)
    Filter for events created after a specified datetime. Events may be generated out of order or the
`subject_changed_at` and `created_at` times of an event can differ due to the lag between event
occurrence and generation. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `created_before` (string)
    Filter for events created before a specified datetime. Events may be generated out of order or the
`subject_changed_at` and `created_at` times of an event can differ due to the lag between event
occurrence and generation. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `event_types` (string)
    Filter for records of specified [event types](https://mavenlink.zendesk.com/hc/en-us/articles/4407962435227).
Specify multiple event types in a comma-separated list, like
`GET /api/v1/subscribed_events?event_types=time_entry:created,time_entry:updated,time_entry:deleted`.

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `subject` (polymorphic) - When included, each event object will include a `subject_ref` that references the subject the event belongs to. The `subject_ref` is a JSON object with an `id` and `key`, where the `key` is the subject type.

For example, a `workspace:updated` event will have a `subject_ref` referencing the workspace, and the `key` will be `workspaces`.

If the subject is not available, `subject_ref` will be null. A subject may be unavailable if it was deleted or was transferred to another account.

  - `most_recent` (boolean)
    If true, only the most recent event will be returned for each subject
(i.e. the most recent change that occurred for each subject). This filter cannot be used
in combination with `most_recent_by_event_type`.

  - `most_recent_by_event_type` (boolean)
    If true, only the most recent event of each event type will be returned for each subject.

For example, if a workspace was created, updated 3 times, and deleted, the following events will be
generated: 1 `workspace:created` event, 3 `workspace:updated` events, and 1 `workspace:deleted` event.
If `most_recent_by_event_type` is true, the `workspace:created` event, the most recent `workspace:updated`
event, and the `workspace:deleted` event will be returned. This filter cannot be used in combination with
`most_recent`.

  - `only` (string)
    Allows you to request one or more resources directly by ID. Multiple IDs can be supplied
in a comma separated list, like `GET /api/v1/workspaces.json?only=5,6,7`.

  - `optional_fields` (array)
    Allows you to request one or more optional fields as an array.

  - `order` (string)
    Supply `order` with the name of a valid sort field for the endpoint and a direction.

Valid values: `created_at:asc` and `created_at:desc`.

  - `page` (integer)

  - `per_page` (integer)

  - `subject_id` (string)
    Filter for events belonging to a specific subject (e.g. a user, a project, etc). When using this filter,
you must also provide a `subject_type`. Multiple IDs can be provided in a comma-separated list
(e.g. `GET /api/v1/subscribed_events?subject_type=TimeEntry&subject_id=27,28,29`).

  - `subject_type` (string)
    Filter for events by a specific subject type. You can pass in only one subject type for this parameter.
  Supported subject types: "AccountColor", "AccountLocation", "AccountMembership", "Assignment", "BudgetChangeOrder",
  "CostRate", "CustomField", "CustomFieldSet", "DefaultStatusSet", "EmailAddress", "Estimate", "EstimateScenario",
  "EstimateScenarioResource", "Expense", "ExpenseReportSubmission", "Invoice", "LineItemLock", "Organization",
  "OrganizationMembership", "Participation", "ProjectAccessControl", "Role", "ScheduleChangeOrder", "Skill",
  "SkillMembership", "StatusSet", "StatusSetOption", "Story", "StoryAllocationDay", "TimeEntry",
  "TimeOffEntry", "TimesheetSubmission", "User", "Vendor", "Workspace", "WorkspaceAllocation", "WorkspaceApprover",
  "WorkspaceGroup", "WorkspaceInvitation", "WorkspaceResource", "WorkspaceStatusSet", "Workweek", "WorkweekMembership".

  - `user_ids` (string)
    Filter for events triggered by specific users. Multiple IDs can be provided in a comma-separated list
(e.g. `GET /api/v1/subscribed_events?user_ids=5,25,45`).

## Response 200:

  - `200` (unknown)
    A list of Subscribed Events have been retrieved.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `subscribed_events` (object)

  - `account_colors` (object)

  - `account_locations` (object)

  - `account_memberships` (object)

  - `assignments` (object)

  - `billing_milestones` (object)

  - `cost_rates` (object)

  - `custom_fields` (object)

  - `custom_field_sets` (object)

  - `estimates` (object)

  - `estimate_scenarios` (object)

  - `estimate_scenario_resources` (object)

  - `expenses` (object)

  - `expense_budgets` (object)

  - `expense_report_submissions` (object)

  - `invoices` (object)

  - `line_item_locks` (object)

  - `organizations` (object)

  - `organization_memberships` (object)

  - `participations` (object)

  - `project_accounting_records` (object)

  - `roles` (object)

  - `skills` (object)

  - `skill_memberships` (object)

  - `task_status_sets` (object)

  - `custom_task_statuses` (object)

  - `stories` (object)

  - `story_allocation_days` (object)

  - `time_entries` (object)

  - `time_off_entries` (object)

  - `timesheet_submissions` (object)

  - `users` (object)

  - `vendors` (object)

  - `workspaces` (object)

  - `workspace_allocations` (object)

  - `workspace_groups` (object)

  - `workspace_invitations` (object)

  - `workspace_resources` (object)

  - `workspace_task_status_sets` (object)

  - `workweeks` (object)

  - `workweek_memberships` (object)

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized request

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403:

  - `403` (unknown)
    Forbidden request

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404:

  - `404` (unknown)
    Page Not Found

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422:

  - `422` (unknown)
    Unprocessable Entity

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503:

  - `503` (unknown)
    Service is unavailable

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

